<extend name="Base:base" />
<block name="title">{$title}</block>
<block name="content">
     <div class="data-table table-striped">
        <form class="ids"  id="saveactive">
            <input type="hidden" name="id" value="{$data.id}">
            <span style="display:inline-block;width:100px;float:left">咨询信息：</span><div class="controls">{$data.message}</div>
            <span>回复：</span>
            <div class="controls">
                <textarea class="textarea" name="reply" id="reply"></textarea>
            </div>
            <input type="button" value="确定" id="but"/>
            </form>
            <div class="digg">{$page}</div>
    </div>
    <script type="text/javascript">
          //导航高亮
            highlight_subnav('{:U('index')}');
        jQuery(document).ready(function($) {
            $("#but").click(function(){
                
                if(!$("#reply").val()){
                    alert("回复内容不可为空");
                    
                }else{
                    $.ajax({
                        type:"post",
                        url:'{:U('Visitor/saveactive')}',
                        data:$("#saveactive").serialize(),
                        success:function(data){
                           
                            if(data.info=="ok"){
                                alert ("回复成功");
                                location.href="U('Visitor/index')";     
                            }
                        }
                    });
                }           
            })
            
            
        })
        
    </script>
    
    </block>
